package com.fadadianqi.logistics.admin;

import com.fadadianqi.logistics.sell.service.BillService;
import com.fadadianqi.logistics.sell.service.InOutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class StatisticsService {

    /**
     * 年度销售总额
     *
     * @param year
     * @return
     */
    public Double totalSales(int year) {
        return billService.sumRealPayables(year);
    }

    /**
     * 年度利润总额
     *
     * @param year
     * @return
     */
    public Double totalCost(int year) {
        return billService.sumCost(year);
    }

    public Double totalPurchase(int year) {
        return billService.sumPurchase(year);
    }

    public Double totalInventory() {
        return billService.sumCost();
    }

    public Double totalInOutMoney(int thisYear) {
        return inOutService.totalMoney(thisYear);
    }

    public Double outMoney(int thisYear) {
        return inOutService.outMoney(thisYear);
    }

    public Double inMoney(int thisYear) {
        return inOutService.inMoney(thisYear);
    }

    public Double totalPurchase() {
        return billService.sumPurchase();
    }

    @Autowired
    private BillService billService;

    @Autowired
    private InOutService inOutService;

}
